{{ $isHome      := .IsHome }}
{{ $favicon     := site.Params.favicon }}
{{ $isDoc       := eq .Section "docs" }}
{{ $description := .Param "description" }}
{{ $title       := cond $isHome site.Title .Title }}
{{ $pageType    := cond $isHome "website" "article" }}
{{ $imageUrl    := site.Params.logos.site }}
{{ $twitter     := (index (where site.Params.social "name" "Twitter") 0).handle }}

<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link rel="canonical" content="{{ .Permalink }}">
<link rel="shortcut icon" href="{{ $favicon }}">

{{ with $description }}
<meta name="description" content="{{ . }}">
{{ end }}

<!-- OpenGraph metadata -->
<meta property="og:title" content="{{ $title }}">
{{ if $isDoc }}
<meta property="og:type" content="documentation">
{{ end }}
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:locale" content="en_US">
{{ if not $isHome }}
<meta property="og:site_name" content="{{ site.Title }}">
{{ end }}
{{ with $description }}
<meta property="og:description" content="{{ . }}">
{{ end }}
<meta name="og:type" content="{{ $pageType }}">
<meta name="og:image" content="{{ $imageUrl }}">
<meta name="og:image:alt" content="{{ site.Title }} project logo">
<meta name="og:image:type" content="image/png">

<!-- Twitter Card metadata -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@{{ $twitter }}">
<meta name="twitter:creator" content="@{{ $twitter }}">
{{ hugo.Generator }}
